#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    int removeDuplicates(vector<int>& nums) {
        int k = 0;
        for (int i = 1; i < nums.size(); i++)
        {
            if (nums[i] != nums[k])
            {
                nums[k + 1] = nums[i];
                k++;
            }
        }
        return k + 1;
    }
};

int main()
{

    return 0;
}